<?php
session_start();
require "../../libraries/config.php";
require "../../libraries/database.php";
require "../../model/admin/login.php";
$name = $_POST['namead'];
$pass = $_POST['passad'];
$db = new login();
$checklogin = $db->checklogin($name, $pass);
if($checklogin== FALSE){
    echo '1';
}  else {
    debug($checklogin);
    $_SESSION['ses_userid'] = $checklogin['userID'];
    $_SESSION['ses_username'] = $checklogin['user_name'];
    $_SESSION['ses_rule'] = $checklogin['ruleID'];
    $_SESSION['ses_userfullname'] = $checklogin['user_fullname'];
    $_SESSION['ses_gender'] = $checklogin['user_gender'];
    $_SESSION['ses_add'] = $checklogin['user_address'];
    $_SESSION['ses_email'] = $checklogin['user_email'];
}